<template>
	<view class="u-page">
		<view class="header"></view>
		<view class="content">
			<view class="userinfo">
				<uni-list :border="border">
				    <uni-list-item  title="会员名称" :rightText="userData.customerName"></uni-list-item>
					<uni-list-item  title="电话号码" :rightText="userData.customerMobile"   ></uni-list-item>
					<uni-list-item  title="会员卡ID" :rightText="userData.cardId"    ></uni-list-item>
					<uni-list-item  title="会员卡号" :rightText="userData.cardNo"    ></uni-list-item>
				</uni-list>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userData:{},
				userid:'',
			}
		},
		onLoad(e) {
			this.userid = e.id
			// let user = uni.getStorageSync('userData');
			// this.userData = user;
			this.userInfo()
			
		},
		methods: {
			//获取用户信息
			async userInfo(){
				const user = await this.GQL({
						"operationName": "allSlUserHllvips",
						"query": "query allSlUserHllvips($filter: SlUserHllvipFilter) { allSlUserHllvips(filter:$filter) { nodes { uid customerName customerMobile customerId createStamp createShopId cardNo cardId id slUserByUid { phone username nickname } } } }",
						"variables": {"filter": {"uid":{"equalTo":this.userid}}}
				})
				console.log('1-----',user)
				if(user.data.allSlUserHllvips.nodes !=''){
					this.userData = user.data.allSlUserHllvips.nodes[0]
				}
			
				// this.userData = user.data.allSlUsers.nodes[0]
				
			},
			
			
			
			
		}
	}
</script>

<style lang="scss">
.header{
		width: 100%;
		height: 200px;
		background: linear-gradient(#C7171E ,#FBFCFE); /* 标准的语法 */
		
	}
	.content{
		position: relative;
		top: -180px;
		margin: 15px;
		background: #FFFFFF;
		height: 607px;
		border-radius: 5px;
		
	}
	.userinfo{
		padding-top: 10px;
	}
</style>
